package com.ftg.learn.chapter04;

/**
 * 回文数
 *
 * @author lijiaxin
 * @version 1.0
 * @date 2023/6/10 11:00
 */

public class Test02 {
    public static void pailndrome(int num){
        int renum=0;
        int ten=10;
        for (int i = num,j=0; i >0 ; i/=ten) {
            renum*=10;
            renum+= num/(int)Math.pow(10,j++)%10;
        }
        System.out.println(num-renum==0?"是回文数":"不是回文数");
    }

    public static void main(String[] args) {
        pailndrome(12345);
    }
}
